import { request } from '@umijs/max';



//通用规则
export async function creatCustomerAddress(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/customer/address/save';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

export async function getCustomerAddressById(id: string): Promise<BackendResponse<any>> {
    let url =`/admin-api/system/customer/address/get/${id}`;
    return request(url, {
        method: 'GET'
    });
}


export async function updateCustomerAddress(id:string,params: any): Promise<BackendResponse<any>> {
    let url =`/admin-api/system/customer/address/update/${id}`;
    return request(url, {
        method: 'PUT',
        data: params,
    });
}



export async function pageListCustomerAddress(params: any): Promise<BackendResponse<any>> {
    let url ='/admin-api/system/customer/address/page';
    return request(url, {
        method: 'POST',
        data: params,
    });
}

export async function deleteCustomerAddress(id: string): Promise<BackendResponse<any>> {
    let url =`/admin-api/system/customer/address/delete/${id}`;
    return request(url, {
        method: 'DELETE'
    });
}


export async function getAddresses(id: string): Promise<BackendResponse<any>> {
    let url =`/admin-api/system/customer/address/get/${id}`;
    return request(url, {
        method: 'GET'
    });
}